﻿using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
using System.Text;
using SilverlightRestServices.Description;
using SilverlightRestServices.Channels;

namespace SilverlightRestServices
{
    public class RestBinding : Binding
    {
        public RestBinding()
        {
        }

        public override BindingElementCollection CreateBindingElements()
        {
            RestMessageEncodingBindingElement encoding = new RestMessageEncodingBindingElement();
            HttpTransportBindingElement transport = new HttpTransportBindingElement();
            transport.ManualAddressing = true;

            return new BindingElementCollection(new BindingElement[] { encoding, transport });
        }

        public override String Scheme
        {
            get { return "HTTP"; }
        }
    }
}
